#include "parafluidbox.h"

using namespace ParaFluid;

Box::~Box()
{
	/* does nothing */
}

Box::Box()
	: OrientedObject()
	, extent()
{
	/* does nothing */
}

Box::Box(const Vector & position, const Orientation & orientation, const Vector & Extent)
	: OrientedObject(position, orientation)
	, extent(Extent)
{
	/* does nothing */
}

Box::Box(const Box & other)
	: OrientedObject(other)
	, extent(other.extent)
{
	/* does nothing */
}

Box & Box::operator= (const Box & rhs)
{
	if(&rhs != this)
	{
		OrientedObject::operator=(rhs);
		extent = rhs.extent;
	}
	return *this;
}

bool Box::operator== (const Box & rhs) const
{
	bool result = true;
	if(&rhs != this)
	{
		result &= OrientedObject::operator==(rhs);
		result &= extent == rhs.extent;
	}
	return result;
}

QDataStream & operator<< (QDataStream & stream, const ParaFluid::Box & box)
{
	stream << box.extent;
	return stream;
}

QDataStream & operator>> (QDataStream & stream, ParaFluid::Box & box)
{
	stream >> box.extent;
	return stream;
}
